package com.wangshouyu.mp.user;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;
import com.wangshouyu.mp.base.response.BaseResponse;

import java.util.List;
import java.util.Objects;

/**
 * @author 王守钰
 * @date 2021年03月17日 17:26
 * @description 用户信息
 */
public class UserInfoResponse extends BaseResponse {

    /**
     * 用户是否订阅该公众号标识，值为0时，代表此用户没有关注该公众号，拉取不到其余信息。
     */
    private Integer subscribe;

    /**
     * 用户的标识，对当前公众号唯一
     */
    @SerializedName(value = "openid")
    @JsonProperty(value = "openid")
    @JSONField(name = "openid")
    private String openId;

    /**
     * 用户的昵称
     */
    @SerializedName(value = "nickname")
    @JsonProperty(value = "nickname")
    @JSONField(name = "nickname")
    private String nickName;

    /**
     * 用户的性别，值为1时是男性，值为2时是女性，值为0时是未知
     */
    private Integer sex;

    /**
     * 用户的语言，简体中文为zh_CN
     */
    private String language;

    /**
     * 用户所在城市
     */
    private String city;

    /**
     * 用户所在省份
     */
    private String province;

    /**
     * 用户所在国家
     */
    private String country;

    /**
     * 用户头像，最后一个数值代表正方形头像大小
     * （有0、46、64、96、132数值可选，0代表640*640正方形头像），
     * 用户没有头像时该项为空。若用户更换头像，原有头像URL将失效。
     */
    @SerializedName(value = "headimgurl")
    @JsonProperty(value = "headimgurl")
    @JSONField(name = "headimgurl")
    private String headImgUrl;

    /**
     * 用户关注时间，为时间戳。如果用户曾多次关注，则取最后关注时间
     */
    @SerializedName(value = "subscribe_time")
    @JsonProperty(value = "subscribe_time")
    @JSONField(name = "subscribe_time")
    private Long subscribeTime;

    /**
     * 只有在用户将公众号绑定到微信开放平台帐号后，才会出现该字段。
     */
    @SerializedName(value = "unionid")
    @JsonProperty(value = "unionid")
    @JSONField(name = "unionid")
    private String unionId;

    /**
     * 公众号运营者对粉丝的备注，公众号运营者可在微信公众平台用户管理界面对粉丝添加备注
     */
    private String remark;

    /**
     * 用户所在的分组ID（兼容旧的用户分组接口）
     */
    @SerializedName(value = "groupid")
    @JsonProperty(value = "groupid")
    @JSONField(name = "groupid")
    private Long groupId;

    /**
     * 用户被打上的标签ID列表
     */
    @SerializedName(value = "tagid_list")
    @JsonProperty(value = "tagid_list")
    @JSONField(name = "tagid_list")
    private List<Long> tagIdList;

    /**
     * 返回用户关注的渠道来源
     */
    @SerializedName(value = "subscribe_scene")
    @JsonProperty(value = "subscribe_scene")
    @JSONField(name = "subscribe_scene")
    private String subscribeScene;

    /**
     * 二维码扫码场景（开发者自定义）
     */
    @SerializedName(value = "qr_scene")
    @JsonProperty(value = "qr_scene")
    @JSONField(name = "qr_scene")
    private Long qrScene;

    /**
     * 二维码扫码场景描述（开发者自定义）
     */
    @SerializedName(value = "qr_scene_str")
    @JsonProperty(value = "qr_scene_str")
    @JSONField(name = "qr_scene_str")
    private String qrSceneStr;

    public Integer getSubscribe() {
        return subscribe;
    }

    public void setSubscribe(Integer subscribe) {
        this.subscribe = subscribe;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getHeadImgUrl() {
        return headImgUrl;
    }

    public void setHeadImgUrl(String headImgUrl) {
        this.headImgUrl = headImgUrl;
    }

    public Long getSubscribeTime() {
        return subscribeTime;
    }

    public void setSubscribeTime(Long subscribeTime) {
        this.subscribeTime = subscribeTime;
    }

    public String getUnionId() {
        return unionId;
    }

    public void setUnionId(String unionId) {
        this.unionId = unionId;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Long getGroupId() {
        return groupId;
    }

    public void setGroupId(Long groupId) {
        this.groupId = groupId;
    }

    public List<Long> getTagIdList() {
        return tagIdList;
    }

    public void setTagIdList(List<Long> tagIdList) {
        this.tagIdList = tagIdList;
    }

    public String getSubscribeScene() {
        return subscribeScene;
    }

    public void setSubscribeScene(String subscribeScene) {
        this.subscribeScene = subscribeScene;
    }

    public Long getQrScene() {
        return qrScene;
    }

    public void setQrScene(Long qrScene) {
        this.qrScene = qrScene;
    }

    public String getQrSceneStr() {
        return qrSceneStr;
    }

    public void setQrSceneStr(String qrSceneStr) {
        this.qrSceneStr = qrSceneStr;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        UserInfoResponse userInfoResponse = (UserInfoResponse) o;
        return Objects.equals(subscribe, userInfoResponse.subscribe) && Objects.equals(openId, userInfoResponse.openId) && Objects.equals(nickName, userInfoResponse.nickName) && Objects.equals(sex, userInfoResponse.sex) && Objects.equals(language, userInfoResponse.language) && Objects.equals(city, userInfoResponse.city) && Objects.equals(province, userInfoResponse.province) && Objects.equals(country, userInfoResponse.country) && Objects.equals(headImgUrl, userInfoResponse.headImgUrl) && Objects.equals(subscribeTime, userInfoResponse.subscribeTime) && Objects.equals(unionId, userInfoResponse.unionId) && Objects.equals(remark, userInfoResponse.remark) && Objects.equals(groupId, userInfoResponse.groupId) && Objects.equals(tagIdList, userInfoResponse.tagIdList) && Objects.equals(subscribeScene, userInfoResponse.subscribeScene) && Objects.equals(qrScene, userInfoResponse.qrScene) && Objects.equals(qrSceneStr, userInfoResponse.qrSceneStr);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), subscribe, openId, nickName, sex, language, city, province, country, headImgUrl, subscribeTime, unionId, remark, groupId, tagIdList, subscribeScene, qrScene, qrSceneStr);
    }

    @Override
    public String toString() {
        super.toString();
        return "UserInfo{" +
                "subscribe=" + subscribe +
                ", openId='" + openId + '\'' +
                ", nickName='" + nickName + '\'' +
                ", sex=" + sex +
                ", language='" + language + '\'' +
                ", city='" + city + '\'' +
                ", province='" + province + '\'' +
                ", country='" + country + '\'' +
                ", headImgUrl='" + headImgUrl + '\'' +
                ", subscribeTime=" + subscribeTime +
                ", unionId='" + unionId + '\'' +
                ", remark='" + remark + '\'' +
                ", groupId=" + groupId +
                ", tagIdList=" + tagIdList +
                ", subscribeScene='" + subscribeScene + '\'' +
                ", qrScene=" + qrScene +
                ", qrSceneStr='" + qrSceneStr + '\'' +
                '}';
    }
}
